package com.niuwa.p2p.dao.business;

import java.util.List;
import java.util.Map;

import com.niuwa.p2p.dao.MyBatisDao;
import com.niuwa.p2p.entity.business.RepayPlan;
import com.niuwa.p2p.vo.front.account.RefundOrSettleBalanceVo;
import com.niuwa.p2p.vo.front.account.TransferDetailVo;

@MyBatisDao
public interface RepayPlanDao {
    int deleteByPrimaryKey(Long id);

    int insert(RepayPlan record);

    int insertSelective(RepayPlan record);

    RepayPlan selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(RepayPlan record);

    int updateByPrimaryKey(RepayPlan record);
    
    /**
	 * @Description: 根据条件查询还款计划
	 * add by bwz at 2015年4月13日
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	public List<RepayPlan> selectRepayPlanListPage(Map<String,Object> paramMap) throws Exception;
	
	
	/**
	 * @Description: 查询借款项目的基本信息 
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	public TransferDetailVo selectRepayplanBaseInfo(Map<String,Object> paramMap) throws Exception;
	
	
	/**
	 * @Description: 查询还款时需要的资金信息
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	public RefundOrSettleBalanceVo getRefundInfo(Map<String,Object> paramMap) throws Exception;
	
	
	/**
	 * @Description: 查询结清时需要的资金信息
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	public RefundOrSettleBalanceVo getSettleBalanceInfo(Map<String,Object> paramMap) throws Exception;
	
	
	/**
	 * @Description: 还款
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	public RepayPlan refund(Map<String,Object> paramMap) throws Exception;
	
	
	/**
	 * @Description: 结清
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	public boolean settleBalance(Map<String,Object> paramMap) throws Exception;
	
	/**
	 * 分页查询还款计划
	 * @param paramMap
	 * @return
	 */
	public List<RepayPlan> selectRepayPlanListByParams(Map<String,Object> paramMap);
	
	
	public int countp2pRepayPlanByParams(Map<String,Object> paramMap);
}